import sa from '../function/global'
import { getStorageSync, setStorageSync } from '../system/store-h5'

var compose = {
  request: function (para) {
    para = para || {}
    para.timeout = para.timeout || 30000
    if (!para.method || !para.url) {
      return false
    }
    // 第一版先只实现get请求的，不需要返回状态
    try {
      var img = new Image()
      img.src = para.url
    } catch (e) {
      sa.log('创建AJAX请求失败' + e)
    }
  },
  getStorageSync: getStorageSync,
  setStorageSync: setStorageSync
}

export default compose
